home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / QD3DRenderer.a < prev    next >
Encoding:
Text File  |  1998-02-12  |  40.7 KB  |  1,276 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        QD3DRenderer.a
  3. ;
  4. ;    Contains:    Q3Renderer types and routines                                          
  5. ;
  6. ;    Version:    Technology:    Quickdraw 3D 1.5.4
  7. ;                Release:    Universal Interfaces 3.1
  8. ;
  9. ;    Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__QD3DRENDERER__') = 'UNDEFINED' THEN
  19. __QD3DRENDERER__ SET 1
  20.  
  21.     IF &TYPE('__QD3D__') = 'UNDEFINED' THEN
  22.     include 'QD3D.a'
  23.     ENDIF
  24.     IF &TYPE('__QD3DSET__') = 'UNDEFINED' THEN
  25.     include 'QD3DSet.a'
  26.     ENDIF
  27.     IF &TYPE('__QD3DVIEW__') = 'UNDEFINED' THEN
  28.     include 'QD3DView.a'
  29.     ENDIF
  30.  
  31.     IF TARGET_OS_MAC THEN
  32.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  33.     include 'Events.a'
  34.     ENDIF
  35.     ENDIF    ; TARGET_OS_MAC
  36. ; ******************************************************************************
  37. ; **                                                                             **
  38. ; **                            User Interface Things                             **
  39. ; **                                                                             **
  40. ; ****************************************************************************
  41.  
  42.     IF TARGET_OS_MAC THEN
  43. ; *  A callback to an application's event handling code. This is needed to    
  44. ; *  support movable modal dialogs. The dialog's event filter calls this      
  45. ; *  callback with events it does not handle.                                 
  46. ; *  If an application handles the event it should return kQ3True.            
  47. ; *  If the application does not handle the event it must return kQ3False and 
  48. ; *  the dialog's event filter will pass the event to the system unhandled.   
  49.  
  50. TQ3DialogAnchor            RECORD 0
  51. clientEventHandler         ds.l    1                ; offset: $0 (0)
  52. sizeof                     EQU *                    ; size:   $4 (4)
  53.                         ENDR
  54.     ENDIF    ; TARGET_OS_MAC
  55.     IF TARGET_OS_WIN32 THEN
  56. TQ3DialogAnchor            RECORD 0
  57. ownerWindow                 ds.l    1                ; offset: $0 (0)
  58. sizeof                     EQU *                    ; size:   $4 (4)
  59.                         ENDR
  60.     ENDIF    ; TARGET_OS_WIN32
  61.     IF TARGET_OS_UNIX THEN
  62. TQ3DialogAnchor            RECORD 0
  63. notUsed                     ds.l    1                ; offset: $0 (0)        ;  place holder 
  64. sizeof                     EQU *                    ; size:   $4 (4)
  65.                         ENDR
  66.     ENDIF    ; TARGET_OS_UNIX
  67. ; ******************************************************************************
  68. ; **                                                                             **
  69. ; **                            Renderer Functions                                 **
  70. ; **                                                                             **
  71. ; ****************************************************************************
  72.  
  73. ;
  74. ; extern TQ3RendererObject Q3Renderer_NewFromType(TQ3ObjectType rendererObjectType)
  75. ;
  76.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  77.         IMPORT_CFM_FUNCTION Q3Renderer_NewFromType
  78.     ENDIF
  79.  
  80. ;
  81. ; extern TQ3ObjectType Q3Renderer_GetType(TQ3RendererObject renderer)
  82. ;
  83.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  84.         IMPORT_CFM_FUNCTION Q3Renderer_GetType
  85.     ENDIF
  86.  
  87.  
  88. ;  Q3Renderer_Flush has been replaced by Q3View_Flush 
  89. ;  Q3Renderer_Sync has been replaced by Q3View_Sync 
  90.  
  91. ; *    Q3Renderer_IsInteractive
  92. ; *        Determine if this renderer is intended to be used interactively.
  93.  
  94. ;
  95. ; extern TQ3Boolean Q3Renderer_IsInteractive(TQ3RendererObject renderer)
  96. ;
  97.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  98.         IMPORT_CFM_FUNCTION Q3Renderer_IsInteractive
  99.     ENDIF
  100.  
  101.  
  102. ; *    Q3Renderer_HasModalConfigure
  103. ; *        Determine if this renderer has a modal settings dialog.
  104. ; *
  105. ; *    Q3Renderer_ModalConfigure
  106. ; *        Have the renderer pop up a modal dialog box to configure its settings.
  107. ; *    dialogAnchor - is platform specific data passed by the client to support
  108. ; *      movable modal dialogs. 
  109. ; *    MacOS: this is a callback to the calling application's event handler.
  110. ; *      The renderer calls this function with events not handled by the 
  111. ; *      settings dialog. This is necessary in order to support movable modal 
  112. ; *      dialogs. An application's event handler must return kQ3True if it 
  113. ; *      handles the event passed to the callback or kQ3False if not. 
  114. ; *      An application which doesn't want to support a movable modal configure
  115. ; *      dialog should pass NULL for the clientEventHandler of TQ3DialogAnchor.
  116. ; *    Win32: this is the HWND of the owning window (typically an application's
  117. ; *      main window).
  118. ; *  canceled - returns a boolean inditacating that the user canceled the 
  119. ; *    dialog.
  120. ; *      
  121.  
  122. ;
  123. ; extern TQ3Boolean Q3Renderer_HasModalConfigure(TQ3RendererObject renderer)
  124. ;
  125.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  126.         IMPORT_CFM_FUNCTION Q3Renderer_HasModalConfigure
  127.     ENDIF
  128.  
  129. ;
  130. ; extern TQ3Status Q3Renderer_ModalConfigure(TQ3RendererObject renderer, TQ3DialogAnchor dialogAnchor, TQ3Boolean *canceled)
  131. ;
  132.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  133.         IMPORT_CFM_FUNCTION Q3Renderer_ModalConfigure
  134.     ENDIF
  135.  
  136. ; *    Q3RendererClass_GetNickNameString
  137. ; *        Allows an application to get a renderers name string, the 
  138. ; *        renderer is responsible for storing this in a localizable format
  139. ; *        for example as a resource.  This string can then be used to provide
  140. ; *        a selection mechanism for an application (for example in a menu).
  141. ; *
  142. ; *        If this call returns nil in the supplied string, then the App may 
  143. ; *         choose to use the class name for the renderer.  You should always 
  144. ; *        try to get the name string before using the class name, since the
  145. ; *        class name is not localizable.
  146.  
  147. ;
  148. ; extern TQ3Status Q3RendererClass_GetNickNameString(TQ3ObjectType rendererClassType, TQ3ObjectClassNameString rendererClassString)
  149. ;
  150.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  151.         IMPORT_CFM_FUNCTION Q3RendererClass_GetNickNameString
  152.     ENDIF
  153.  
  154.  
  155. ; *    Q3Renderer_GetConfigurationData
  156. ; *        Allows an application to collect private renderer configuration data
  157. ; *      which it will then save. For example in a preference file or in a 
  158. ; *        style template. An application should tag this data with the 
  159. ; *        Renderer's object  name.
  160. ; *    
  161. ; *        if dataBuffer is NULL actualDataSize returns the required size in 
  162. ; *        bytes of a data buffer large enough to store private data. 
  163. ; *
  164. ; *      bufferSize is the actual size of the memory block pointed to by 
  165. ; *        dataBuffer
  166. ; *
  167. ; *        actualDataSize - on return the actual number of bytes written to the 
  168. ; *        buffer or if dataBuffer is NULL the required size of dataBuffer
  169. ; * 
  170.  
  171. ;
  172. ; extern TQ3Status Q3Renderer_GetConfigurationData(TQ3RendererObject renderer, unsigned char *dataBuffer, unsigned long bufferSize, unsigned long *actualDataSize)
  173. ;
  174.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  175.         IMPORT_CFM_FUNCTION Q3Renderer_GetConfigurationData
  176.     ENDIF
  177.  
  178. ;
  179. ; extern TQ3Status Q3Renderer_SetConfigurationData(TQ3RendererObject renderer, unsigned char *dataBuffer, unsigned long bufferSize)
  180. ;
  181.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  182.         IMPORT_CFM_FUNCTION Q3Renderer_SetConfigurationData
  183.     ENDIF
  184.  
  185.  
  186.  
  187. ; ******************************************************************************
  188. ; **                                                                             **
  189. ; **                        Interactive Renderer Specific Functions                 **
  190. ; **                                                                             **
  191. ; ****************************************************************************
  192.  
  193. ;  CSG IDs attribute 
  194. ;  Object IDs, to be applied as attributes on geometries 
  195.  
  196. kQ3AttributeTypeConstructiveSolidGeometryID EQU 'csgi'
  197.  
  198. kQ3SolidGeometryObjNone            EQU        -1
  199. kQ3SolidGeometryObjA            EQU        0
  200. kQ3SolidGeometryObjB            EQU        1
  201. kQ3SolidGeometryObjC            EQU        2
  202. kQ3SolidGeometryObjD            EQU        3
  203. kQ3SolidGeometryObjE            EQU        4
  204. ;  Possible CSG equations 
  205.  
  206. ; typedef long                            TQ3CSGEquation
  207. kQ3CSGEquationAandB                EQU        $88888888
  208. kQ3CSGEquationAandnotB            EQU        $22222222
  209. kQ3CSGEquationAanBonCad            EQU        $2F222F22
  210. kQ3CSGEquationnotAandB            EQU        $44444444
  211. kQ3CSGEquationnAaBorCanB        EQU        $74747474
  212.  
  213. ; typedef long                            TQ3HiddenSurfaceRemovalMode
  214. kQ3HiddenSurfaceRemovalMode_None EQU    0
  215. kQ3HiddenSurfaceRemovalMode_Shallow EQU    1
  216. kQ3HiddenSurfaceRemovalMode_Deep EQU    2
  217. ;
  218. ; extern TQ3Status Q3InteractiveRenderer_SetCSGEquation(TQ3RendererObject renderer, TQ3CSGEquation equation)
  219. ;
  220.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  221.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_SetCSGEquation
  222.     ENDIF
  223.  
  224. ;
  225. ; extern TQ3Status Q3InteractiveRenderer_GetCSGEquation(TQ3RendererObject renderer, TQ3CSGEquation *equation)
  226. ;
  227.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  228.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_GetCSGEquation
  229.     ENDIF
  230.  
  231. ;
  232. ; extern TQ3Status Q3InteractiveRenderer_SetPreferences(TQ3RendererObject renderer, long vendorID, long engineID)
  233. ;
  234.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  235.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_SetPreferences
  236.     ENDIF
  237.  
  238. ;
  239. ; extern TQ3Status Q3InteractiveRenderer_GetPreferences(TQ3RendererObject renderer, long *vendorID, long *engineID)
  240. ;
  241.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  242.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_GetPreferences
  243.     ENDIF
  244.  
  245. ;
  246. ; extern TQ3Status Q3InteractiveRenderer_SetDoubleBufferBypass(TQ3RendererObject renderer, TQ3Boolean bypass)
  247. ;
  248.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  249.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_SetDoubleBufferBypass
  250.     ENDIF
  251.  
  252. ;
  253. ; extern TQ3Status Q3InteractiveRenderer_GetDoubleBufferBypass(TQ3RendererObject renderer, TQ3Boolean *bypass)
  254. ;
  255.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  256.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_GetDoubleBufferBypass
  257.     ENDIF
  258.  
  259. ;
  260. ; extern TQ3Status Q3InteractiveRenderer_SetRAVEContextHints(TQ3RendererObject renderer, unsigned long RAVEContextHints)
  261. ;
  262.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  263.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_SetRAVEContextHints
  264.     ENDIF
  265.  
  266. ;
  267. ; extern TQ3Status Q3InteractiveRenderer_GetRAVEContextHints(TQ3RendererObject renderer, unsigned long *RAVEContextHints)
  268. ;
  269.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  270.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_GetRAVEContextHints
  271.     ENDIF
  272.  
  273. ;
  274. ; extern TQ3Status Q3InteractiveRenderer_SetRAVETextureFilter(TQ3RendererObject renderer, unsigned long RAVEtextureFilterValue)
  275. ;
  276.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  277.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_SetRAVETextureFilter
  278.     ENDIF
  279.  
  280. ;
  281. ; extern TQ3Status Q3InteractiveRenderer_GetRAVETextureFilter(TQ3RendererObject renderer, unsigned long *RAVEtextureFilterValue)
  282. ;
  283.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  284.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_GetRAVETextureFilter
  285.     ENDIF
  286.  
  287.  
  288. ; ******************************************************************************
  289. ; **                                                                             **
  290. ; **                            Renderer View Tools                                 **
  291. ; **                                                                             **
  292. ; **                    You may only call these methods from a plug-in             **
  293. ; **                                                                             **
  294. ; ****************************************************************************
  295.  
  296. ; *    Call by a renderer to call the user "idle" method, with progress 
  297. ; *    information.
  298. ; *    
  299. ; *    Pass in (view, 0, n) on first call
  300. ; *    Pass in (view, 1..n-1, n) during rendering
  301. ; *    Pass in (view, n, n) upon completion
  302. ; *    
  303. ; *    Note: The user must have supplied an idleProgress method with 
  304. ; *    Q3XView_SetIdleProgressMethod. Otherwise, the generic idle method is
  305. ; *    called with no progress data. e.g. the Q3View_SetIdleMethod method
  306. ; *    is called instead. (current and final are ignored, essentially.)
  307. ; *
  308. ; *    Returns kQ3Failure if rendering is cancelled.
  309.  
  310. ;
  311. ; extern TQ3Status Q3XView_IdleProgress(TQ3ViewObject view, unsigned long current, unsigned long completed)
  312. ;
  313.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  314.         IMPORT_CFM_FUNCTION Q3XView_IdleProgress
  315.     ENDIF
  316.  
  317. ; *    Called by an asynchronous renderer when it completes a frame.
  318.  
  319. ;
  320. ; extern TQ3Status Q3XView_EndFrame(TQ3ViewObject view)
  321. ;
  322.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  323.         IMPORT_CFM_FUNCTION Q3XView_EndFrame
  324.     ENDIF
  325.  
  326.  
  327. ; ******************************************************************************
  328. ; **                                                                             **
  329. ; **                            Renderer AttributeSet Tools                         **
  330. ; **                                                                             **
  331. ; **                    You may only call these methods from a plug-in             **
  332. ; **                                                                             **
  333. ; ****************************************************************************
  334.  
  335. ; *    Faster access to geometry attribute sets.
  336. ; *    
  337. ; *    Returns pointer to INTERNAL data structure for elements and attributes
  338. ; *    in an attributeSet, or NULL if no attribute exists.
  339. ; *    
  340. ; *    For attributes of type kQ3AttributeType..., the internal data structure
  341. ; *    is identical to the data structure used in Q3AttributeSet_Add.
  342.  
  343. ;
  344. ; extern void *Q3XAttributeSet_GetPointer(TQ3AttributeSet attributeSet, TQ3AttributeType attributeType)
  345. ;
  346.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  347.         IMPORT_CFM_FUNCTION Q3XAttributeSet_GetPointer
  348.     ENDIF
  349.  
  350.  
  351.  
  352. kQ3XAttributeMaskNone            EQU        0
  353. kQ3XAttributeMaskSurfaceUV        EQU        $01
  354. kQ3XAttributeMaskShadingUV        EQU        $02
  355. kQ3XAttributeMaskNormal            EQU        $04
  356. kQ3XAttributeMaskAmbientCoefficient EQU    $08
  357. kQ3XAttributeMaskDiffuseColor    EQU        $10
  358. kQ3XAttributeMaskSpecularColor    EQU        $20
  359. kQ3XAttributeMaskSpecularControl EQU    $40
  360. kQ3XAttributeMaskTransparencyColor EQU    $80
  361. kQ3XAttributeMaskSurfaceTangent    EQU        $0100
  362. kQ3XAttributeMaskHighlightState    EQU        $0200
  363. kQ3XAttributeMaskSurfaceShader    EQU        $0400
  364. kQ3XAttributeMaskCustomAttribute EQU    $80000000
  365. kQ3XAttributeMaskAll            EQU        $800007FF
  366. kQ3XAttributeMaskInherited        EQU        $03FF
  367. kQ3XAttributeMaskInterpolated    EQU        $01FF
  368. ; typedef unsigned long                 TQ3XAttributeMask
  369.  
  370. ;
  371. ; extern TQ3XAttributeMask Q3XAttributeSet_GetMask(TQ3AttributeSet attributeSet)
  372. ;
  373.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  374.         IMPORT_CFM_FUNCTION Q3XAttributeSet_GetMask
  375.     ENDIF
  376.  
  377.  
  378. ; ******************************************************************************
  379. ; **                                                                             **
  380. ; **                            Renderer Draw Context Tools                         **
  381. ; **                                                                             **
  382. ; ****************************************************************************
  383.  
  384.  
  385.  
  386. ;
  387. ; extern TQ3Status Q3XDrawContext_GetDrawRegion(TQ3DrawContextObject drawContext, TQ3XDrawRegion *drawRegion)
  388. ;
  389.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  390.         IMPORT_CFM_FUNCTION Q3XDrawContext_GetDrawRegion
  391.     ENDIF
  392.  
  393.  
  394. ; typedef long                            TQ3XDrawContextValidationMasks
  395. kQ3XDrawContextValidationClearFlags EQU    $00000000
  396. kQ3XDrawContextValidationDoubleBuffer EQU $01
  397. kQ3XDrawContextValidationShader    EQU        $02
  398. kQ3XDrawContextValidationClearFunction EQU $04
  399. kQ3XDrawContextValidationActiveBuffer EQU $08
  400. kQ3XDrawContextValidationInternalOffScreen EQU $10
  401. kQ3XDrawContextValidationPane    EQU        $20
  402. kQ3XDrawContextValidationMask    EQU        $40
  403. kQ3XDrawContextValidationDevice    EQU        $80
  404. kQ3XDrawContextValidationWindow    EQU        $0100
  405. kQ3XDrawContextValidationWindowSize EQU    $0200
  406. kQ3XDrawContextValidationWindowClip EQU    $0400
  407. kQ3XDrawContextValidationWindowPosition EQU $0800
  408. kQ3XDrawContextValidationPlatformAttributes EQU $1000
  409. kQ3XDrawContextValidationForegroundShader EQU $2000
  410. kQ3XDrawContextValidationBackgroundShader EQU $4000
  411. kQ3XDrawContextValidationColorPalette EQU $8000
  412. kQ3XDrawContextValidationAll    EQU        $FFFFFFFF
  413. ; typedef unsigned long                 TQ3XDrawContextValidation
  414.  
  415. ;
  416. ; extern TQ3Status Q3XDrawContext_ClearValidationFlags(TQ3DrawContextObject drawContext)
  417. ;
  418.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  419.         IMPORT_CFM_FUNCTION Q3XDrawContext_ClearValidationFlags
  420.     ENDIF
  421.  
  422. ;
  423. ; extern TQ3Status Q3XDrawContext_GetValidationFlags(TQ3DrawContextObject drawContext, TQ3XDrawContextValidation *validationFlags)
  424. ;
  425.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  426.         IMPORT_CFM_FUNCTION Q3XDrawContext_GetValidationFlags
  427.     ENDIF
  428.  
  429.  
  430. ; ******************************************************************************
  431. ; **                                                                             **
  432. ; **                            Renderer Draw Region Tools                         **
  433. ; **                                                                             **
  434. ; ****************************************************************************
  435.  
  436.  
  437. ; typedef long                            TQ3XDevicePixelType
  438.                                                             ; These do not indicate byte ordering   
  439. kQ3XDevicePixelTypeInvalid        EQU        0                    ; Unknown, un-initialized type     
  440. kQ3XDevicePixelTypeRGB32        EQU        1                    ; Alpha:8 (ignored), R:8, G:8, B:8 
  441. kQ3XDevicePixelTypeARGB32        EQU        2                    ; Alpha:8, R:8, G:8, B:8              
  442. kQ3XDevicePixelTypeRGB24        EQU        3                    ; 24 bits/pixel, R:8, G:8, B:8     
  443. kQ3XDevicePixelTypeRGB16        EQU        4                    ; Alpha:1 (ignored), R:5, G:5, B:5 
  444. kQ3XDevicePixelTypeARGB16        EQU        5                    ; Alpha:1, R:5, G:5, B:5              
  445. kQ3XDevicePixelTypeRGB16_565    EQU        6                    ; 16 bits/pixel, R:5, G:6, B:5     
  446. kQ3XDevicePixelTypeIndexed8        EQU        7                    ; 8-bit color table index             
  447. kQ3XDevicePixelTypeIndexed4        EQU        8                    ; 4-bit color table index             
  448. kQ3XDevicePixelTypeIndexed2        EQU        9                    ; 2-bit color table index             
  449. kQ3XDevicePixelTypeIndexed1        EQU        10                    ; 1-bit color table index             
  450.  
  451. ; typedef long                            TQ3XClipMaskState
  452. kQ3XClipMaskFullyExposed        EQU        0
  453. kQ3XClipMaskPartiallyExposed    EQU        1
  454. kQ3XClipMaskNotExposed            EQU        2
  455. TQ3XColorDescriptor        RECORD 0
  456. redShift                 ds.l    1                ; offset: $0 (0)
  457. redMask                     ds.l    1                ; offset: $4 (4)
  458. greenShift                 ds.l    1                ; offset: $8 (8)
  459. greenMask                 ds.l    1                ; offset: $C (12)
  460. blueShift                 ds.l    1                ; offset: $10 (16)
  461. blueMask                 ds.l    1                ; offset: $14 (20)
  462. alphaShift                 ds.l    1                ; offset: $18 (24)
  463. alphaMask                 ds.l    1                ; offset: $1C (28)
  464. sizeof                     EQU *                    ; size:   $20 (32)
  465.                         ENDR
  466. TQ3XDrawRegionDescriptor RECORD 0
  467. width                     ds.l    1                ; offset: $0 (0)
  468. height                     ds.l    1                ; offset: $4 (4)
  469. rowBytes                 ds.l    1                ; offset: $8 (8)
  470. pixelSize                 ds.l    1                ; offset: $C (12)
  471. pixelType                 ds.l    1                ; offset: $10 (16)
  472. colorDescriptor             ds        TQ3XColorDescriptor ; offset: $14 (20)
  473. bitOrder                 ds.l    1                ; offset: $34 (52)
  474. byteOrder                 ds.l    1                ; offset: $38 (56)
  475. clipMask                 ds.l    1                ; offset: $3C (60)
  476. sizeof                     EQU *                    ; size:   $40 (64)
  477.                         ENDR
  478.  
  479. ; typedef long                            TQ3XDrawRegionServicesMasks
  480. kQ3XDrawRegionServicesNoneFlag    EQU        0
  481. kQ3XDrawRegionServicesClearFlag    EQU        $01
  482. kQ3XDrawRegionServicesDontLockDDSurfaceFlag EQU $02
  483. ; typedef unsigned long                 TQ3XDrawRegionServices
  484.  
  485. ;
  486. ; extern TQ3Status Q3XDrawRegion_GetDeviceScaleX(TQ3XDrawRegion drawRegion, float *deviceScaleX)
  487. ;
  488.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  489.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetDeviceScaleX
  490.     ENDIF
  491.  
  492. ;
  493. ; extern TQ3Status Q3XDrawRegion_GetDeviceScaleY(TQ3XDrawRegion drawRegion, float *deviceScaleY)
  494. ;
  495.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  496.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetDeviceScaleY
  497.     ENDIF
  498.  
  499.  
  500. ;
  501. ; extern TQ3Status Q3XDrawRegion_GetDeviceOffsetX(TQ3XDrawRegion drawRegion, float *deviceOffsetX)
  502. ;
  503.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  504.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetDeviceOffsetX
  505.     ENDIF
  506.  
  507. ;
  508. ; extern TQ3Status Q3XDrawRegion_GetDeviceOffsetY(TQ3XDrawRegion drawRegion, float *deviceOffsetX)
  509. ;
  510.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  511.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetDeviceOffsetY
  512.     ENDIF
  513.  
  514.  
  515. ;
  516. ; extern TQ3Status Q3XDrawRegion_GetWindowScaleX(TQ3XDrawRegion drawRegion, float *windowScaleX)
  517. ;
  518.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  519.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetWindowScaleX
  520.     ENDIF
  521.  
  522. ;
  523. ; extern TQ3Status Q3XDrawRegion_GetWindowScaleY(TQ3XDrawRegion drawRegion, float *windowScaleY)
  524. ;
  525.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  526.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetWindowScaleY
  527.     ENDIF
  528.  
  529.  
  530. ;
  531. ; extern TQ3Status Q3XDrawRegion_GetWindowOffsetX(TQ3XDrawRegion drawRegion, float *windowOffsetX)
  532. ;
  533.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  534.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetWindowOffsetX
  535.     ENDIF
  536.  
  537. ;
  538. ; extern TQ3Status Q3XDrawRegion_GetWindowOffsetY(TQ3XDrawRegion drawRegion, float *windowOffsetY)
  539. ;
  540.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  541.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetWindowOffsetY
  542.     ENDIF
  543.  
  544. ;
  545. ; extern TQ3Status Q3XDrawRegion_IsActive(TQ3XDrawRegion drawRegion, TQ3Boolean *isActive)
  546. ;
  547.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  548.         IMPORT_CFM_FUNCTION Q3XDrawRegion_IsActive
  549.     ENDIF
  550.  
  551.  
  552. ;
  553. ; extern TQ3Status Q3XDrawRegion_GetNextRegion(TQ3XDrawRegion drawRegion, TQ3XDrawRegion *nextDrawRegion)
  554. ;
  555.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  556.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetNextRegion
  557.     ENDIF
  558.  
  559. ;  
  560. ; *  One of the next two functions must be called before using a draw region 
  561.  
  562. ; *    Use this Start function if double buffering/image access services from the
  563. ; *    Draw Context are not needed, you may still request clear for example
  564.  
  565. ;
  566. ; extern TQ3Status Q3XDrawRegion_Start(TQ3XDrawRegion drawRegion, TQ3XDrawRegionServices services, TQ3XDrawRegionDescriptor **descriptor)
  567. ;
  568.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  569.         IMPORT_CFM_FUNCTION Q3XDrawRegion_Start
  570.     ENDIF
  571.  
  572. ; *    Use this Start function if double buffering or image access services from 
  573. ; *  the Draw Context are needed.
  574.  
  575. ;
  576. ; extern TQ3Status Q3XDrawRegion_StartAccessToImageBuffer(TQ3XDrawRegion drawRegion, TQ3XDrawRegionServices services, TQ3XDrawRegionDescriptor **descriptor, void **image)
  577. ;
  578.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  579.         IMPORT_CFM_FUNCTION Q3XDrawRegion_StartAccessToImageBuffer
  580.     ENDIF
  581.  
  582. ; *    This function is used to indicate that access to a DrawRegion is ended.
  583.  
  584. ;
  585. ; extern TQ3Status Q3XDrawRegion_End(TQ3XDrawRegion drawRegion)
  586. ;
  587.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  588.         IMPORT_CFM_FUNCTION Q3XDrawRegion_End
  589.     ENDIF
  590.  
  591. ;
  592. ; extern TQ3Status Q3XDrawRegion_GetDeviceTransform(TQ3XDrawRegion drawRegion, TQ3Matrix4x4 **deviceTransform)
  593. ;
  594.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  595.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetDeviceTransform
  596.     ENDIF
  597.  
  598. ;
  599. ; extern TQ3Status Q3XDrawRegion_GetClipFlags(TQ3XDrawRegion drawRegion, TQ3XClipMaskState *clipMaskState)
  600. ;
  601.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  602.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetClipFlags
  603.     ENDIF
  604.  
  605. ;
  606. ; extern TQ3Status Q3XDrawRegion_GetClipMask(TQ3XDrawRegion drawRegion, TQ3Bitmap **clipMask)
  607. ;
  608.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  609.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetClipMask
  610.     ENDIF
  611.  
  612.     IF TARGET_OS_MAC THEN
  613. ;
  614. ; extern TQ3Status Q3XDrawRegion_GetClipRegion(TQ3XDrawRegion drawRegion, RgnHandle *rgnHandle)
  615. ;
  616.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  617.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetClipRegion
  618.     ENDIF
  619.  
  620. ;
  621. ; extern TQ3Status Q3XDrawRegion_GetGDHandle(TQ3XDrawRegion drawRegion, GDHandle *gdHandle)
  622. ;
  623.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  624.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetGDHandle
  625.     ENDIF
  626.  
  627.     ENDIF    ; TARGET_OS_MAC
  628. ;
  629. ; extern TQ3Status Q3XDrawRegion_GetRendererPrivate(TQ3XDrawRegion drawRegion, void **rendererPrivate)
  630. ;
  631.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  632.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetRendererPrivate
  633.     ENDIF
  634.  
  635. ;
  636. ; extern TQ3Status Q3XDrawRegion_SetRendererPrivate(TQ3XDrawRegion drawRegion, const void *rendererPrivate, TQ3XDrawRegionRendererPrivateDeleteMethod deleteMethod)
  637. ;
  638.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  639.         IMPORT_CFM_FUNCTION Q3XDrawRegion_SetRendererPrivate
  640.     ENDIF
  641.  
  642. ;
  643. ; extern TQ3Status Q3XDrawRegion_SetUseDefaultRendererFlag(TQ3XDrawRegion drawRegion, TQ3Boolean flag)
  644. ;
  645.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  646.         IMPORT_CFM_FUNCTION Q3XDrawRegion_SetUseDefaultRendererFlag
  647.     ENDIF
  648.  
  649. ;
  650. ; extern TQ3Status Q3XDrawRegion_GetUseDefaultRendererFlag(TQ3XDrawRegion drawRegion, TQ3Boolean *useDefaultRenderingFlag)
  651. ;
  652.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  653.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetUseDefaultRendererFlag
  654.     ENDIF
  655.  
  656.  
  657.  
  658. ; ******************************************************************************
  659. ; **                                                                             **
  660. ; **                            Renderer Class Methods                             **
  661. ; **                                                                             **
  662. ; ****************************************************************************
  663.  
  664. ; *    Methods from Object
  665. ; *        kQ3XMethodTypeObjectClassRegister
  666. ; *        kQ3XMethodTypeObjectClassUnregister
  667. ; *        kQ3XMethodTypeObjectNew
  668. ; *        kQ3XMethodTypeObjectDelete
  669. ; *        kQ3XMethodTypeObjectRead
  670. ; *        kQ3XMethodTypeObjectTraverse
  671. ; *        kQ3XMethodTypeObjectWrite
  672. ; *        
  673. ; *    Methods from Shared
  674. ; *        kQ3MethodTypeSharedEdited
  675. ; *
  676. ; *    Renderer Methods
  677. ; *    
  678. ; *    The renderer methods should be implemented according to the type
  679. ; *    of renderer being written.
  680. ; *
  681. ; *    For the purposes of documentation, there are two basic types of
  682. ; *    renderers: 
  683. ; *
  684. ; *        Interactive
  685. ; *            Interactive Renderer
  686. ; *            WireFrame Renderer
  687. ; *        
  688. ; *        Deferred
  689. ; *            a ray-tracer
  690. ; *            painter's algorithm renderer (cached in a BSP triangle tree)
  691. ; *            an artistic renderer (simulates a pencil drawing, etc.)
  692. ; *
  693. ; *    The main difference is how each renderer handles incoming state and 
  694. ; *    geometry.
  695. ; *
  696. ; *    An interactive renderer immediately transforms, culls, and shades
  697. ; *    incoming geometry and performs rasterization. For example, in a 
  698. ; *    single-buffered WireFrame renderer, you will see a new triangle
  699. ; *    immediately after Q3Triangle_Draw (if it's visible, of course).
  700. ; *
  701. ; *    A deferred renderer caches the view state and each geometry, 
  702. ; *    converting into any internal queue of drawing commands. Rasterization
  703. ; *    is not actually performed until all data has been submitted.
  704. ; *    
  705. ; *    For example, a ray-tracer may not rasterize anything until the
  706. ; *    end of the rendering loop, or until an EndFrame call is made.
  707.  
  708.  
  709. ; ******************************************************************************
  710. ; **                                                                             **
  711. ; **                        Renderer User Interface Methods                         **
  712. ; **                                                                             **
  713. ; ****************************************************************************
  714.  
  715. ; *    kQ3XMethodTypeRendererIsInteractive
  716. ; *    
  717. ; *    There is no actual method with this - the metahandler simply returns
  718. ; *  "(TQ3XFunctionPointer)kQ3True" for this "method" if the renderer is 
  719. ; *  intended to be used in interactive settings, and   
  720. ; *    "(TQ3XFunctionPointer)kQ3False" otherwise. 
  721. ; *  
  722. ; *  If neither value is specified in the metahandler, the renderer 
  723. ; *  is *assumed to be non-interactive*!!!
  724. ; *    
  725. ; *    OPTIONAL
  726.  
  727.  
  728. kQ3XMethodTypeRendererIsInteractive EQU    'isin'
  729.  
  730. ; *    TQ3XRendererModalConfigureMethod
  731. ; *    
  732. ; *    This method should pop up a modal dialog to edit the renderer settings 
  733. ; *    found in the renderer private. 
  734. ; *    
  735. ; *    dialogAnchor - is platform specific data passed by the client to support
  736. ; *      movable modal dialogs. 
  737. ; *    MacOS: this is a callback to the calling application's event handler.
  738. ; *      The renderer calls this function with events not handled by the 
  739. ; *      settings dialog. This is necessary in order to support movable modal 
  740. ; *      dialogs. An application's event handler must return kQ3True if it 
  741. ; *      handles the event passed to the callback or kQ3False if not. 
  742. ; *      An application which doesn't want to support a movable modal configure
  743. ; *      dialog should pass NULL for the clientEventHandler of TQ3DialogAnchor.
  744. ; *      A renderer should implement a non-movable style dialog in that case.
  745. ; *    Win32: this is the HWND of the owning window (typically an application's
  746. ; *      main window).  (Win32 application modal dialogs are always movable.)
  747. ; *  canceled - returns a boolean inditacating that the user canceled the 
  748. ; *    dialog.
  749. ; *    
  750. ; *    OPTIONAL
  751.  
  752.  
  753. kQ3XMethodTypeRendererModalConfigure EQU 'rdmc'
  754. ; *    kQ3XMethodTypeRendererGetNickNameString
  755. ; *    
  756. ; *        Allows an application to collect the name of the renderer for
  757. ; *        display in a user interface item such as a menu.
  758. ; *    
  759. ; *        If dataBuffer is NULL actualDataSize returns the required size in 
  760. ; *        bytes of a data buffer large enough to store the renderer name. 
  761. ; *
  762. ; *      bufferSize is the actual size of the memory block pointed to by 
  763. ; *        dataBuffer
  764. ; *
  765. ; *        actualDataSize - on return the actual number of bytes written to the
  766. ; *        buffer or if dataBuffer is NULL the required size of dataBuffer
  767. ; *
  768. ; *    OPTIONAL
  769.  
  770.  
  771. kQ3XMethodTypeRendererGetNickNameString EQU 'rdns'
  772. ; *    kQ3XMethodTypeRendererGetConfigurationData
  773. ; *    
  774. ; *        Allows an application to collect private configuration data from the
  775. ; *      renderer which it will then save. For example in a preference file, 
  776. ; *      a registry key (on Windows) or in a style template. An application 
  777. ; *      should tag this data with the renderer's object name.
  778. ; *    
  779. ; *        If dataBuffer is NULL actualDataSize returns the required size in 
  780. ; *        bytes of a data buffer large enough to store private data. 
  781. ; *
  782. ; *      bufferSize is the actual size of the memory block pointed to by 
  783. ; *        dataBuffer
  784. ; *
  785. ; *        actualDataSize - on return the actual number of bytes written to the
  786. ; *        buffer or if dataBuffer is NULL the required size of dataBuffer
  787. ; *
  788. ; *    OPTIONAL
  789.  
  790.  
  791. kQ3XMethodTypeRendererGetConfigurationData EQU 'rdgp'
  792. ; *    TQ3XRendererSetConfigurationDataMethod
  793. ; *    
  794. ; *        Allows an application to pass private configuration data which has
  795. ; *         previously  been obtained from a renderer via 
  796. ; *        Q3Renderer_GetConfigurationData. For example in a preference file or 
  797. ; *        in a style template. An application should tag this data with the 
  798. ; *        renderer's object name.
  799. ; *    
  800. ; *      bufferSize is the actual size of the memory block pointed to by 
  801. ; *        dataBuffer
  802. ; *
  803. ; *    OPTIONAL
  804.  
  805.  
  806. kQ3XMethodTypeRendererSetConfigurationData EQU 'rdsp'
  807. ; ******************************************************************************
  808. ; **                                                                             **
  809. ; **                        Renderer Drawing State Methods                         **
  810. ; **                                                                             **
  811. ; ****************************************************************************
  812.  
  813. ; *    TQ3RendererStartFrame
  814. ; *    
  815. ; *    The StartFrame method is called first at Q3View_StartRendering
  816. ; *    and should:
  817. ; *        - initialize any renderer state to defaults
  818. ; *        - extract any and all useful data from the drawContext
  819. ; *
  820. ; *    If your renderer passed in kQ3RendererFlagClearBuffer at 
  821. ; *    registration, then it should also:
  822. ; *        - clear the drawContext 
  823. ; *    
  824. ; *        When clearing, your renderer may opt to:
  825. ; *        - NOT clear anything (if you touch every pixel, for example)
  826. ; *        - to clear with your own routine, or
  827. ; *        - to use the draw context default clear method by calling 
  828. ; *        Q3DrawContext_Clear. Q3DrawContext_Clear takes advantage of
  829. ; *        any available hardware in the system for clearing.
  830. ; *    
  831. ; *    This call also signals the start of all default submit commands from
  832. ; *    the view. The renderer will receive updates for the default view
  833. ; *    state via its Update methods before StartPass is called.
  834. ; *    
  835. ; *    REQUIRED
  836.  
  837.  
  838. kQ3XMethodTypeRendererStartFrame EQU    'rdcl'
  839. ; *    kQ3XMethodTypeRendererStartPass
  840. ; *    TQ3XRendererStartPassMethod
  841. ; *    
  842. ; *    The StartPass method is called during Q3View_StartRendering but after
  843. ; *    the StartFrame command. It should:
  844. ; *        - collect camera and light information
  845. ; *    
  846. ; *    If your renderer supports deferred camera transformation, camera is the
  847. ; *    main camera which will be submitted in the hierarchy somewhere. It
  848. ; *    is never NULL.
  849. ; *
  850. ; *    If your renderer does not support deferred camera transformation, camera
  851. ; *    is the transformed camera.
  852. ; *
  853. ; *    If your renderer supports deferred light transformation, lights will be
  854. ; *    NULL, and will be submitted to your light draw methods instead.
  855. ; *
  856. ; *    This call signals the end of the default update state, and the start of 
  857. ; *  submit commands from the user to the view.
  858. ; *
  859. ; *    REQUIRED
  860.  
  861.  
  862. kQ3XMethodTypeRendererStartPass    EQU        'rdst'
  863. ; *    kQ3XMethodTypeRendererFlushFrame
  864. ; *    TQ3XRendererFlushFrameMethod
  865. ; *    
  866. ; *    This call is only implemented by asynchronous renderers.
  867. ; *    
  868. ; *    The FlushFrame method is called between the StartPass and EndPass
  869. ; *    methods and is called when the user wishes to flush any asynchronous
  870. ; *    drawing tasks (which draw to the drawcontext), but does not want 
  871. ; *    to block.
  872. ; *    
  873. ; *    The result of this call is that an image should "eventually" appear
  874. ; *    asynchronously.
  875. ; *    
  876. ; *    For asynchronous rendering, this call is non-blocking.
  877. ; *    
  878. ; *    An interactive renderer should ensure that all received
  879. ; *    geometries are drawn in the image.
  880. ; *    
  881. ; *    An interactive renderer that talks to hardware should force
  882. ; *    the hardware to generate an image.
  883. ; *    
  884. ; *    A deferred renderer should exhibit a similar behaviour,
  885. ; *    though it is not required.  A deferred renderer should spawn
  886. ; *    a process that generates a partial image from the currently
  887. ; *    accumulated drawing state. 
  888. ; *    
  889. ; *    However, for renderers such as ray-tracers which generally are
  890. ; *    quite compute-intensive, FlushFrame is not required and is a no-op.
  891. ; *
  892. ; *    OPTIONAL
  893.  
  894.  
  895. kQ3XMethodTypeRendererFlushFrame EQU    'rdfl'
  896. ; *    kQ3XMethodTypeRendererEndPass
  897. ; *    TQ3XRendererEndPassMethod
  898. ; *    
  899. ; *    The EndPass method is called at Q3View_EndRendering and signals
  900. ; *    the end of submit commands to the view.
  901. ; *
  902. ; *    If an error occurs, the renderer should call Q3XError_Post and
  903. ; *    return kQ3ViewStatusError.
  904. ; *    
  905. ; *    If a renderer requires another pass on the renderering data,
  906. ; *    it should return kQ3ViewStatusRetraverse.
  907. ; *    
  908. ; *    If rendering was cancelled, this function will not be called
  909. ; *    and the view will handle returning kQ3ViewStatusCancelled;
  910. ; *    
  911. ; *    Otherwise, your renderer should begin completing the process of 
  912. ; *    generating the image in the drawcontext. If you have buffered
  913. ; *    any drawing data, flush it. RendererEnd should have a similar
  914. ; *    effect as RendererFlushFrame.
  915. ; *    
  916. ; *    If the renderer is synchronous:
  917. ; *        - complete rendering of the entire frame
  918. ; *        if the renderer supports kQ3RendererClassSupportDoubleBuffer
  919. ; *            - Update the front buffer
  920. ; *        else
  921. ; *            - DrawContext will update the front buffer after returning
  922. ; *
  923. ; *    If the renderer is asynchronous
  924. ; *        - spawn rendering thread for entire frame
  925. ; *        if the renderer supports kQ3RendererClassSupportDoubleBuffer,
  926. ; *            - you must eventually update the front buffer asynchronously
  927. ; *        else
  928. ; *            - you must eventually update the back buffer asynchronously
  929. ; *            
  930. ; *    REQUIRED
  931.  
  932.  
  933. kQ3XMethodTypeRendererEndPass    EQU        'rded'
  934. ; *    kQ3XMethodTypeRendererEndFrame
  935. ; *    TQ3XRendererEndFrame
  936. ; *    
  937. ; *    This call is only implemented by asynchronous renderers.
  938. ; *
  939. ; *    The EndFrame method is called from Q3View_Sync, which is
  940. ; *    called after Q3View_EndRendering and signals that the user
  941. ; *    wishes to see the completed image and is willing to block.
  942. ; *    
  943. ; *    If your renderer supports kQ3RendererFlagDoubleBuffer
  944. ; *        - update the front buffer completely 
  945. ; *    else
  946. ; *        - update the back buffer completely
  947. ; *
  948. ; *    This call is equivalent in functionality to RendererFlushFrame
  949. ; *    but blocks until the image is completed.
  950. ; *    
  951. ; *    If no method is supplied, the default is a no-op.
  952. ; *    
  953. ; *    NOTE: Registering a method of this type indicates that your renderer will
  954. ; *    be rendering after Q3View_EndRendering has been called.
  955. ; *    
  956. ; *    OPTIONAL
  957.  
  958.  
  959. kQ3XMethodTypeRendererEndFrame    EQU        'rdsy'
  960. ; *    The RendererCancel method is called after Q3View_StartRendering
  961. ; *    and signals the termination of all rendering operations.
  962. ; *
  963. ; *    A renderer should clean up any cached data, and cancel all 
  964. ; *    rendering operations.
  965. ; *    
  966. ; *    If called before Q3View_EndRendering, the RendererEnd method
  967. ; *    is NOT called.
  968. ; *    
  969. ; *    If called after Q3View_EndRendering, the renderer should kill
  970. ; *    any threads and terminate any further rendering.
  971. ; *    
  972. ; *    REQUIRED
  973.  
  974.  
  975. kQ3XMethodTypeRendererCancel    EQU        'rdab'
  976. ; ******************************************************************************
  977. ; **                                                                             **
  978. ; **                        Renderer DrawContext Methods                         **
  979. ; **                                                                             **
  980. ; ****************************************************************************
  981.  
  982. ; *    kQ3XMethodTypeRendererPush
  983. ; *    TQ3XRendererPushMethod
  984. ; *    
  985. ; *    kQ3XMethodTypeRendererPop
  986. ; *    TQ3XRendererPopMethod
  987. ; *    
  988. ; *    These methods are called whenever the graphics state in the view
  989. ; *    is pushed or popped. The user may isolate state by calling:
  990. ; *    
  991. ; *    Q3Attribute_Submit(kQ3AttributeTypeDiffuseColor, &red, view);
  992. ; *    Q3Attribute_Submit(kQ3AttributeTypeTransparencyColor, &blue, view);
  993. ; *    Q3Attribute_Submit(kQ3AttributeTypeSpecularColor, &white, view);
  994. ; *    Q3Box_Submit(&unitBox, view);
  995. ; *    Q3TranslateTransform_Submit(&unitVector, view);
  996. ; *    Q3Push_Submit(view);
  997. ; *        Q3Attribute_Submit(kQ3AttributeTypeDiffuseColor, &blue, view);
  998. ; *        Q3Attribute_Submit(kQ3AttributeTypeTransparencyColor, &green, view);
  999. ; *        Q3Box_Submit(&unitBox, view);
  1000. ; *    Q3Pop_Submit(view);    
  1001. ; *    Q3TranslateTransform_Submit(&unitVector, view);
  1002. ; *    Q3Box_Submit(&unitBox, view);
  1003. ; *    
  1004. ; *    or by submitting a display group which pushes and pops.
  1005. ; *    
  1006. ; *    If you support RendererPush and RendererPop in your renderer:
  1007. ; *        - you must maintain your drawing state as a stack, as well.
  1008. ; *        - you will not be updated with the popped state after
  1009. ; *            RendererPop is called.
  1010. ; *
  1011. ; *    If you do not support Push and Pop in your renderer:
  1012. ; *        - you may maintain a single copy of the drawing state.
  1013. ; *        - you will be updated with changed fields after the view stack is
  1014. ; *            popped.
  1015. ; *
  1016. ; *    A renderer that supports Push and Pop gets called in the following
  1017. ; *    sequence (from example above):
  1018. ; *    
  1019. ; *    RendererUpdateAttributeDiffuseColor(&red,...)
  1020. ; *    RendererUpdateAttributeTransparencyColor(&blue,...)
  1021. ; *    RendererUpdateAttributeSpecularColor(&white,...)
  1022. ; *    RendererUpdateMatrixLocalToWorld(...)
  1023. ; *    RendererSubmitGeometryBox(...)
  1024. ; *    RendererPush(...)
  1025. ; *        RendererUpdateAttributeDiffuseColor(&blue,...)
  1026. ; *        RendererUpdateAttributeTransparencyColor(&green,...)
  1027. ; *        RendererSubmitGeometryBox(...)
  1028. ; *    RendererPop(...)
  1029. ; *    RendererUpdateMatrixLocalToWorld(...)
  1030. ; *    RendererSubmitGeometryBox(...)
  1031. ; *
  1032. ; *    A renderer that does not supports Push and Pop gets called in the
  1033. ; *    following sequence:
  1034. ; *    
  1035. ; *    RendererUpdateAttributeDiffuseColor(&red,...)
  1036. ; *    RendererUpdateAttributeTransparencyColor(&blue,...)
  1037. ; *    RendererUpdateAttributeSpecularColor(&white,...)
  1038. ; *    RendererUpdateMatrixLocalToWorld(...)
  1039. ; *    RendererSubmitGeometryBox(...)
  1040. ; *        RendererUpdateAttributeDiffuseColor(&blue,...)
  1041. ; *        RendererUpdateAttributeTransparencyColor(&green,...)
  1042. ; *        RendererSubmitGeometryBox(...)
  1043. ; *    RendererUpdateAttributeDiffuseColor(&red,...)
  1044. ; *    RendererUpdateAttributeTransparencyColor(&blue,...)
  1045. ; *    RendererUpdateMatrixLocalToWorld(...)
  1046. ; *    RendererSubmitGeometryBox(...)
  1047. ; *    
  1048.  
  1049.  
  1050. kQ3XMethodTypeRendererPush        EQU        'rdps'
  1051.  
  1052. kQ3XMethodTypeRendererPop        EQU        'rdpo'
  1053. ; ******************************************************************************
  1054. ; **                                                                             **
  1055. ; **                            Renderer Cull Methods                             **
  1056. ; **                                                                             **
  1057. ; ****************************************************************************
  1058.  
  1059. ; *    kQ3XMethodTypeRendererIsBoundingBoxVisible
  1060. ; *    TQ3XRendererIsBoundingBoxVisibleMethod
  1061. ; *    
  1062. ; *    This method is called to cull complex groups and geometries 
  1063. ; *    given their bounding box in local space.
  1064. ; *    
  1065. ; *    It should transform the local-space bounding box coordinates to
  1066. ; *    frustum space and return a TQ3Boolean return value indicating
  1067. ; *    whether the box appears within the viewing frustum.
  1068. ; *    
  1069. ; *    If no method is supplied, the default behavior is to return
  1070. ; *    kQ3True.
  1071. ; *    
  1072.  
  1073.  
  1074. kQ3XMethodTypeRendererIsBoundingBoxVisible EQU 'rdbx'
  1075.  
  1076. ; ******************************************************************************
  1077. ; **                                                                             **
  1078. ; **                        Renderer Object Support Methods                         **
  1079. ; **                                                                             **
  1080. ; ****************************************************************************
  1081.  
  1082. ; *    Drawing methods (Geometry, Camera, Lights)
  1083. ; *
  1084.  
  1085. ; *    Geometry MetaHandler
  1086. ; *    
  1087. ; *    This metaHandler is required to support 
  1088. ; *    
  1089. ; *    kQ3GeometryTypeTriangle
  1090. ; *    kQ3GeometryTypeLine
  1091. ; *    kQ3GeometryTypePoint
  1092. ; *    kQ3GeometryTypeMarker
  1093. ; *    kQ3GeometryTypePixmapMarker
  1094. ; *    
  1095. ; *    REQUIRED
  1096.  
  1097.  
  1098. kQ3XMethodTypeRendererSubmitGeometryMetaHandler EQU 'rdgm'
  1099. ; *    The TQ3XRendererSubmitGeometryMetaHandlerMethod switches on geometryType
  1100. ; *    of kQ3GeometryTypeFoo and returns methods of type:
  1101.  
  1102. ; *    Camera MetaHandler
  1103. ; *    
  1104. ; *    This metaHandler, if supplied, indicates that your renderer
  1105. ; *    handles deferred transformation of the main camera within a scene.
  1106. ; *    
  1107. ; *    If not supplied, or an unsupported camera is used, the view will do
  1108. ; *    the transformation for the renderer and pass in a camera in the 
  1109. ; *    StartPass method.
  1110. ; *    
  1111. ; *    OPTIONAL
  1112.  
  1113.  
  1114. kQ3XMethodTypeRendererSubmitCameraMetaHandler EQU 'rdcm'
  1115. ; *    The TQ3XRendererSubmitCameraMetaHandlerMethod switches on cameraType
  1116. ; *    of kQ3CameraTypeFoo and returns methods of type:
  1117.  
  1118. ; *    Light MetaHandler
  1119. ; *    
  1120. ; *    This metaHandler, if supplied, indicates that your renderer
  1121. ; *    handles deferred transformation of lights within a scene.
  1122. ; *    
  1123. ; *    If an unsupported light is encountered, it is ignored.
  1124. ; *
  1125. ; *    OPTIONAL
  1126.  
  1127.  
  1128. kQ3XMethodTypeRendererSubmitLightMetaHandler EQU 'rdlg'
  1129. ; *    The TQ3XRendererSubmitLightMetaHandlerMethod switches on lightType
  1130. ; *    of kQ3LightTypeFoo and returns methods of type:
  1131.  
  1132. ; *
  1133. ; *    Update methods
  1134. ; *
  1135. ; *    They are called whenever the state has changed. If the renderer supports
  1136. ; *    the RendererPush and RendererPop methods, it must maintain its own state
  1137. ; *    stack. Updates are not called for changed data when the view stack is
  1138. ; *    popped.
  1139. ; *
  1140. ; *    See the comments for the RendererPush and RendererPop methods above
  1141. ; *    for an example of how data is updated.
  1142. ; *
  1143.  
  1144. ; *    Style
  1145.  
  1146.  
  1147. kQ3XMethodTypeRendererUpdateStyleMetaHandler EQU 'rdyu'
  1148. ; *    The TQ3XRendererUpdateStyleMetaHandlerMethod switches on styleType
  1149. ; *    of kQ3StyleTypeFoo and returns methods of type:
  1150.  
  1151. ; *    Attributes
  1152.  
  1153.  
  1154. kQ3XMethodTypeRendererUpdateAttributeMetaHandler EQU 'rdau'
  1155. ; *    The TQ3XRendererUpdateStyleMetaHandlerMethod switches on attributeType
  1156. ; *    of kQ3AttributeTypeFoo and returns methods of type:
  1157.  
  1158. ; *    Shaders
  1159.  
  1160.  
  1161. kQ3XMethodTypeRendererUpdateShaderMetaHandler EQU 'rdsu'
  1162. ; *    The TQ3XRendererUpdateShaderMetaHandlerMethod switches on shaderType
  1163. ; *    of kQ3ShaderTypeFoo and returns methods of type:
  1164.  
  1165. ; *    Matrices
  1166.  
  1167.  
  1168. kQ3XMethodTypeRendererUpdateMatrixMetaHandler EQU 'rdxu'
  1169. ; typedef TQ3XMetaHandler                 TQ3XRendererUpdateMatrixMetaHandlerMethod
  1170.  
  1171. ; *    The TQ3XRendererUpdateShaderMetaHandlerMethod switches on methods
  1172. ; *    of the form kQ3MethodTypeRendererUpdateMatrixFoo:
  1173.  
  1174.  
  1175. kQ3XMethodTypeRendererUpdateMatrixLocalToWorld EQU 'ulwx'
  1176.  
  1177. kQ3XMethodTypeRendererUpdateMatrixLocalToWorldInverse EQU 'ulwi'
  1178.  
  1179. kQ3XMethodTypeRendererUpdateMatrixLocalToWorldInverseTranspose EQU 'ulwt'
  1180.  
  1181. kQ3XMethodTypeRendererUpdateMatrixLocalToCamera EQU 'ulcx'
  1182.  
  1183. kQ3XMethodTypeRendererUpdateMatrixLocalToFrustum EQU 'ulfx'
  1184.  
  1185. kQ3XMethodTypeRendererUpdateMatrixWorldToFrustum EQU 'uwfx'
  1186. ; *    and returns methods of type:
  1187.  
  1188.  
  1189.     ENDIF ; __QD3DRENDERER__ 
  1190.  
  1191.